<div class="row animate fadeIn">
    <form class="form-horizontal">

                <div class="ibox-title" style="border:none;"><h5 style="color: #00afef"><i>Item View</i></h5>
                </div>
                <div class="ibox-content">
                    <?php foreach($result as $items) { ?>
                    <input type="hidden" value="<?php echo $items->item_id; ?>" name="item_id">
                    <input type="hidden" value="<?php echo $items->bu_id; ?>" name="bu">
                        <div class="form-group">
                            <label class="col-lg-2 control-label">Item Number</label>
                            <div class="col-lg-4">
                                <input type="text" class="form-control" name="item_number" value="<?php echo $items->item_num; ?>" readonly>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 control-label">Description</label>
                            <div class="col-lg-2">
                                <input type="text" class="form-control" name="item_description" value="<?php echo $items->description; ?>" readonly>
                            </div>
                        </div>
                        <div class="form-group"><label class="col-sm-2 control-label">Base UOM</label>
                            <div class="col-sm-2">
                                <select style="width: 100px;" class="chosen-select"  name="item_uom" disabled>
                                    <?php foreach ($uom as $uom_data) { ?>
                                        <option value="<?php echo $uom_data->uom_code; ?>" <?php echo($uom_data->uom_code == $items->base_uom ? 'selected' : '' ); ?> ><?php echo $uom_data->uom_code; ?></option>
                                    <?php } ?>
                                </select>
                            </div>
                        </div>
                        <div class="form-group"><label class="col-sm-2 control-label">Item Type</label>
                            <div class="col-sm-4">
                                    <select style="width: 189px;" class="chosen-select"  name="item_type" disabled>
                                        <option value=""> </option>
                                        <?php foreach ($type as $inv_types) { ?>
                                            <option value="<?php echo $inv_types->item_type; ?>" <?php echo($inv_types->item_type == $items->item_type ? 'selected' : '' ); ?> ><?php echo $inv_types->meaning; ?></option>
                                        <?php } ?>
                                    </select>
                            </div>
                        </div>
                        <div class="form-inline form-group" >
                            <div><label class="col-sm-2 control-label">Item Group</label>
                                <div class="col-lg-4">
                                    <select style="width: 189px;" class="chosen-select"  name="item_group" disabled>
                                        <option value=""> </option>
                                        <?php foreach ($groups as $inv_groups) { ?>
                                            <option value="<?php echo $inv_groups->item_group; ?>" <?php echo($inv_groups->item_group == $items->item_group ? 'selected' : '' ); ?> ><?php echo $inv_groups->meaning; ?></option>
                                        <?php } ?>
                                    </select>
                                </div>
                            </div>
                            <div><label class="col-sm-2 control-label">Status</label>
                                
                            </div><div class="col-sm-2    ">
                                    <select class="chosen-select" style="width: 110px;" id="pType2" name="item_status" disabled>
                                        <option value="A" <?php echo($items->item_status == "A" ? 'selected' : '' ); ?> >Active</option>
                                        <option value="O" <?php echo($items->item_status == "O" ? 'selected' : '' ); ?> >Obsolete</option>
                                    </select>
                                </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 control-label">COGS Acct</label>
                            <div class="col-lg-4">
                                    <select style="width: 189px;" class="chosen-select"  name="cogs_acct" disabled>
                                        <option value=""> </option>
                                        <?php foreach ($cogs as $cogs_acct) { ?>
                                            <option value="<?php echo $cogs_acct->account_id; ?>" <?php echo($cogs_acct->account_id == $items->cogs_acct_id ? 'selected' : '' ); ?> ><?php echo $cogs_acct->acct_name; ?> (<?php echo $cogs_acct->acct_code; ?>)</option>
                                        <?php } ?>
                                    </select>
                                </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 control-label">Expense Acct</label>
                            <div class="col-lg-4">
                                    <select style="width: 189px;" class="chosen-select"  name="exp_acct" disabled>
                                        <option value=""> </option>
                                        <?php foreach ($expense as $exp_acct) { ?>
                                            <option value="<?php echo $exp_acct->account_id; ?>" <?php echo($exp_acct->account_id == $items->expense_acct_id ? 'selected' : '' ); ?> ><?php echo $exp_acct->acct_name; ?> (<?php echo $exp_acct->acct_code; ?>)</option>
                                        <?php } ?>
                                    </select>
                                </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 control-label">Sales Acct</label>
                            <div class="col-lg-4">
                                    <select style="width: 189px;" class="chosen-select" name="sales_acct" disabled>
                                        <option value=""> </option>
                                        <?php foreach ($sales as $sl_acct) { ?>
                                            <option value="<?php echo $sl_acct->account_id; ?>" <?php echo($sl_acct->account_id == $items->sales_acct_id ? 'selected' : '' ); ?> ><?php echo $sl_acct->acct_name; ?> (<?php echo $sl_acct->acct_code; ?>)</option>
                                        <?php } ?>
                                    </select>
                                </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2 control-label">Unit Selling Price</label>
                            <div class="col-lg-3">
                                <div class="input-group m-b"><span class="input-group-addon">P</span> <input name="unit_selling_price" type="text" class="form-control text-right" readonly value="<?php echo $items->unit_selling_price; ?>"></div>
                            </div>
                        </div>
                        <div class="form-inline form-group" >
                            <div><label class="col-lg-2 control-label">Inventory</label>
                                <div class="col-lg-1">
                                    <input type="checkbox" value="ok" class="i-checks" name="inv" <?php echo($items->inventory_flag == "Y" ? 'checked' : '' ); ?> disabled>
                                </div>
                            </div>
                            <div><label class="col-lg-2 control-label">Purchasing</label>
                                <div class="col-lg-1">
                                    <input type="checkbox" value="ok" class="i-checks" name="pur" <?php echo($items->purchasing_flag == "Y" ? 'checked' : '' ); ?> disabled>
                                </div>
                            </div>
                        </div>
                        <div class="form-inline form-group" >
                            <div><label class="col-lg-2 control-label">Set</label>
                                <div class="col-lg-1">
                                    <input type="checkbox" value="ok" class="i-checks" name="set" <?php echo($items->set_flag == "Y" ? 'checked' : '' ); ?> disabled>
                                </div>
                            </div>
                            <div><label class="col-lg-2 control-label">Costing</label>
                                <div class="col-lg-1">
                                    <input type="checkbox" value="ok" class="i-checks" name="cos" <?php echo($items->costing_flag == "Y" ? 'checked' : '' ); ?> disabled>
                                </div>
                            </div>
                        </div>
                        <div class="form-inline form-group" >
                             <div><label class="col-lg-2 control-label">Sell</label>
                                <div class="col-lg-1">
                                    <input type="checkbox" value="ok" class="i-checks" name="sel" <?php echo($items->sell_flag == "Y" ? 'checked' : '' ); ?> disabled>
                            </div>
                            <div><label class="col-lg-2 control-label">Enabled</label>
                                <div class="col-lg-1">
                                    <input type="checkbox" value="ok" class="i-checks" name="ena" <?php echo($items->enable_flag == "Y" ? 'checked' : '' ); ?> disabled>
                                </div>
                            </div>
                        </div>
                        <?php } ?>
                    </form>
                </div>
            </div>
<script>
    $('.i-checks').iCheck({
                    checkboxClass: 'icheckbox_square-green',
                    radioClass: 'iradio_square-green',
        }); 
    $(".chosen-select").chosen();   
    $('#viewX').click(function(){
            close_view();
       });
</script>